package com.android.baseconfig.common.entity;

import android.content.Context;
import android.os.Build;
import android.transition.ChangeBounds;
import android.transition.Slide;
import android.transition.TransitionSet;
import android.util.AttributeSet;

import androidx.annotation.RequiresApi;

/**
 * @author lei
 * @description CustomTransition
 * @date 2018/6/21
 */
public class CustomTransition extends TransitionSet {

    @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
    public CustomTransition() {
        init();
    }

    @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
    public CustomTransition(Context context, AttributeSet attrs) {
        super(context, attrs);
        init();
    }

    @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
    private void init() {
        setOrdering(ORDERING_TOGETHER);
        addTransition(new Slide())
                .addTransition(new ChangeBounds());
    }
}
